<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fn="http://www.w3.org/2005/02/xpath-functions">
    <xsl:param name="DOTNET2"/>
    
    
	<xsl:template match="Class"><xsl:variable name="Name" select="LName"/>&lt;?php
// GENNIT CakePHP Project http://www.gennit.com
//
// Project: <xsl:value-of select="HeaderInfo/ProjectName"/>
//
// **************************************************************
// IMPORTANT BIT:
//
// This source code is is owned by you. No copyright is held by
// GENNIT. However, please note the disclaimer below
// **************************************************************
//
// GENNIT refers to the GENNIT website and anyone affiliated
// with the GENNIT system. Including but not limited to
// the administrator and service provider.
//
// Unless agreed to in writing, source code is distributed on an 
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
// either express or implied. GENNIT are not responsible for 
// your use/misuse of this code.

// When you use GENNIT code, you do so at your own risk and 
// GENNIT is not responsible for the accuracy, 
// reliability or functionality of the code. GENNIT expressly 
// disclaims any potential liability associated with use of 
// this generated code.
	
class <xsl:value-of select="Name"/> extends AppModel
{
	// Object Name
	var $name = '<xsl:value-of select="Name"/>';

	
	// Links to other objects
	<xsl:if test="count(ClassAttribs/ClassAttributes[KnownClass='true' and CType='single'])&gt;0">
	var $belongsTo = 
		array (</xsl:if>
	<xsl:for-each select="ClassAttribs/ClassAttributes[KnownClass='true' and CType='single']"><xsl:if test="position()!=1">,</xsl:if>
			'<xsl:value-of select="Name"/>' =&gt;
				array ( 'className' =&gt; '<xsl:value-of select="Type"/>',
					'conditions' =&gt; '',
					'order' =&gt; '',
					'dependent' =&gt; false,
					'foreignKey' =&gt; '<xsl:value-of select="Name"/>_id'
				)</xsl:for-each>
	<xsl:if test="count(ClassAttribs/ClassAttributes[KnownClass='true' and CType='single'])&gt;0">
		);</xsl:if>	

	
	// Has and Belongs to Many are array items which may be shared
	<xsl:if test="count(ClassAttribs/ClassAttributes[CType!='single'])&gt;0">
	var $hasAndBelongsToMany = 
		array (</xsl:if>
	<xsl:for-each select="ClassAttribs/ClassAttributes[CType!='single']"><xsl:if test="position()!=1">,</xsl:if>
			'<xsl:value-of select="Name"/>' =&gt;
			array ( 'className' =&gt; '<xsl:value-of select="Type"/>',
				'joinTable' =&gt; '<xsl:value-of select="$Name"/>s_<xsl:value-of select="LName"/>',
				'foreignKey' =&gt; '<xsl:value-of select="$Name"/>_id',
				'associationForeignKey' =&gt; '_<xsl:value-of select="LType"/>_id',
				'conditions' =&gt; '',
				'order' =&gt; '',
				'limit' =&gt; '',
				'unique' =&gt; false,
				'finderQuery'  => '',
				'deleteQuery'  => '',
			)</xsl:for-each>
	<xsl:if test="count(ClassAttribs/ClassAttributes[CType!='single'])&gt;0">
		);</xsl:if>
}
?&gt;</xsl:template>
    
    
    
    
    
    
</xsl:stylesheet>